//
//  MyQRCodeController.m
//  DianDangDai
//
//  Created by bhf on 2017/12/23.
//  Copyright © 2017年 bhf. All rights reserved.
//

#import "MyQRCodeController.h"

@interface MyQRCodeController ()
@property (strong, nonatomic) IBOutlet UIImageView *headImage;

@end

@implementation MyQRCodeController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)setupViews {
    self.title = @"个人信息";
    dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1/*延迟执行时间*/ * NSEC_PER_SEC));
    
    dispatch_after(delayTime, dispatch_get_main_queue(), ^{
        _headImage.layer.cornerRadius = _headImage.frame.size.width/2;
        _headImage.clipsToBounds = YES;
    });
}

- (void)requestData {
    NSDictionary *userInformation = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"userInformation"];
    NSString *sign = userInformation[@"sign"];
    NSString *urlString = [NSString stringWithFormat:@"%@OPT=1019&sign=%@",API_LOGIN_URL_STRING,sign];
    NSLog(@"%@",urlString);
    [[CDHttpHelper defaultCDHttpHelper] get:urlString params:nil success:^(id responseObj) {
        NSDictionary *dict = [responseObj objectFromJSONData];
        NSLog(@"%@",dict);
        [self.QRCodeImg sd_setImageWithURL:[NSURL URLWithString:@"http://apitest.diandangdai.com/data/attachments/e23825f9-9f3a-458c-b708-7f59b5715375.png"] placeholderImage:nil];
    } failure:^(NSError *error) {
        
    } showHUD:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
